<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>掃碼報工及異常停機</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">	
		<link rel="stylesheet" href="./4/lumen/bootstrap.css" media="screen">
		<link rel="stylesheet" href="./_assets/css/custom.min.css">
	</head>
	<body>
		<div class="container">
			<div class="form-group row">
				<label class="col-sm-2 col-form-label" for="inputDefault">请选择任务名称:</label>
				<div class="col-sm-1">
					<select name="WP" class="form-control" id="WP" type="text">
						<option value="-">-</option>
						<option value="春季">春季</option>
						<option value="夏季">夏季</option>
						<option value="秋季">秋季</option>
						<option value="冬季">冬季</option>
						<option value="年中">年中</option>
						<option value="年末">年末</option>
					</select>
				</div>
			</div>	
			<div class="row">
				<label class="col-sm-2 col-form-label" for="inputDefault">請输入信息</label>
				<input class="form-control" placeholder="AN1811074-X 35M5 4" id="box" type="text">
			</div>
			
			<div class="row" id="Work_situation">
				
				
			</div>
		
		</div>
		<script src="./_vendor/jquery/dist/jquery.min.js"></script>
		<script src="./_vendor/popper.js/dist/umd/popper.min.js"></script>
		<script src="./_vendor/bootstrap/dist/js/bootstrap.min.js"></script>
		<script src="./_assets/js/custom.js"></script>
		<script>
			var times = GetTimeStr(1);
			var msg = new SpeechSynthesisUtterance(times+"");
			console.log(msg);
			window.speechSynthesis.speak(msg);
			var Product_Number=0;//用于ID动态地址的递增
			var k=0;//用来判定是否是第一次扫描
			
			var cho;//锁定相同机台号的ID
			
			var database = new Array();//存入数据库的数据
			
			var datacata=0;//记录扫到一次END内的盒数
			var dataslices=0;//记录扫到一次END内的片数
			var jitaihao;//机台号
			var time = null;//先定义时间变量
			database[2]=0;//存入数据库的数据
			database[3]=0;
			
			$("#box").keypress(function(e){
				key = e.which;
				if(key==13){//按下回车之后的操作
				
					var Assets=$("#box").val();//收集回来的信息
					
					FrontTwoString=(Assets.substring(0,2));//前两位
					if(FrontTwoString=="AX"){
						
						var  Assets_ID = $("<div class='card-header' id='"+'Assets_ID'+Product_Number+"'></div>").append("资产编号:"+Assets);
						var  Assets_name = $("<p id='"+'Assets_name'+Product_Number+"'></p>").append("名称:");
						
						var ss=$("<div  class='card-body' id='"+'ss'+Product_Number+"'></div>").append(Assets_name);
						//$("<tr id='"+'shipmenttr'+disksnumber+"'></tr>");
						$("<div class='card border-primary mb-3' style='max-width: 20rem;' id='"+'CODE'+Product_Number+"'> </div>")
							.append(Assets_ID).append(ss)
							.appendTo("#Work_situation");
					}
					else{
						$("#Assets_name").val();
					}
					//alert($("#Machine"+Product_Number).text());
					$("#box").val("");
				}
			});
			//计算某天之后的日期,-1为昨天,0为今天,1为明天
			function GetDateStr(AddDayCount) {
				var dd = new Date();
				dd.setDate(dd.getDate()+AddDayCount);//获取AddDayCount天后的日期
				var y = dd.getFullYear();
				var m = dd.getMonth()+1;//获取当前月份的日期
				var d = dd.getDate();
				var hh = dd.getHours();  //获取当前小时数(0-23)
				var min = dd.getMinutes();
				var ss = dd.getSeconds();
				return y + "-" + m + "-" + d;
			}
			//计算某天之后的时间,-1为昨天,0为今天,1为明天
			function GetTimeStr(AddDayCount) {
				var dd = new Date();
				dd.setDate(dd.getDate()+AddDayCount);//获取AddDayCount天后的日期
				var y = dd.getFullYear();
				var m = dd.getMonth()+1;//获取当前月份的日期
				var d = dd.getDate();
				var hh = dd.getHours();  //获取当前小时数(0-23)
				var min = dd.getMinutes();
				var ss = dd.getSeconds();
				return hh + ":" + min + ":" + ss;
			}
		
		</script>
	</body>
</html>